SHELL = /bin/bash

# Use google's repo tool to set up and checkout tree
.PHONY: init
init:
	repo init -u https://gitee.com/yocto-openlayers/meta-sifive-autoio.git -b master -m tools/manifests/sifive-qt5.xml
	repo sync -j12

# Download and build packages. This step takes a long time
.PHONY: build-riscv-qt5-wayland
build-riscv-qt5-wayland:
	(. ./meta-sifive-autoio/environment-setup; \
	 MACHINE=qemuriscv64 bitbake demo-coreip-qt5 \
	)

.PHONY: build-riscv-sdk
build-riscv-sdk:
	(. ./meta-sifive-autoio/environment-setup; \
	 MACHINE=qemuriscv64 bitbake meta-toolchain-qt5 \
	)

# Run yocto Qt5 GUI using weston/wayland
.PHONY: run-riscv-qt5-wayland
run-riscv-qt5-wayland:
	(. ./meta-sifive-autoio/environment-setup; \
	 cd tmp/deploy/images/qemuriscv64; \
	 runqemu qemuparams="-m 1024 \
	 -device virtio-gpu-pci \
	 -device virtio-keyboard-pci \
	 -device virtio-mouse-pci \
	 -display sdl \
	 -serial mon:stdio -serial null -show-cursor -monitor null" \
	)

